<template>
	<view class="">
		<s-pull-scroll ref="pullScroll" :pullDown="pullDown" :pullUp="loadData" :back-top="true">
			<view class="wu-con">
				<view class="wu-item">
					<view class="wu-info cell-tit">
						 物流单号:{{emsNo}}
					</view>
					<!-- <view class="wu-info cell-tit">
						物流状态:{{state==1?'已揽收':state==3?'已签收':state==4?'已退签':'派件中'}}
					</view> -->
				</view>
			</view>
			<ali :state="state" :datas="dataList" ></ali>
		</s-pull-scroll>
		<mix-loading v-if="isLoading"></mix-loading>
	</view>
</template>

<script>
	import ali from "@/components/ali/exporss.vue"
	export default {
		components:{
			ali
		},
		data() {
			return {
				state:'',
				dataList:[],
				emsCode:'',
				emsNo:'',
				emsName:''
			}
		},
		onLoad(options) {
			this.emsCode=options.id;
			this.emsName=options.name;
			this.emsNo=options.num;
			this.refresh();
		},
		methods: {
			refresh() {
				this.$nextTick(() => {
					this.$refs.pullScroll.refresh();
				});
			},
			pullDown(pullScroll) {
				setTimeout(() => {
					this.loadData(pullScroll);
				}, 200)
			},
			async loadData(pullScroll) {
				// this.emsNo='773080667614174';
				// this.emsCode='shentong';
				let data = {
					emsCode: this.emsCode,
					emsNo:this.emsNo
				}
				const res=await this.$request('goods/delivery',data,{showLoading:true});
				if(res.result==0){
					
					if(res.data){
						this.dataList=res.data.Traces;
						this.state=res.state;
					}
					
					
				}
				pullScroll.finish();
	
			}
		}
	}
</script>
<style>
	page{
		background: #FFFFFF;
	}
</style>

<style lang="scss" scoped>
	.wu-item {
		padding:20upx 0;
		border-bottom: 1upx solid #F2F2F2;
	}

	.cell-tit {
		color: #333333;
		font-size: 24upx;

	}

	.cell-tip {
		color: #333;
		font-size: 24upx;
	}

	.wu-con {
		padding:24upx;
		box-sizing: border-box;
	}
</style>
